package com.woniuxy.service.impl;

import com.woniuxy.entity.Residents;
import com.woniuxy.mapper.ResidentsMapper;
import com.woniuxy.service.ResidentService;
import com.woniuxy.util.ResponseEnum;
import com.woniuxy.util.ResponseUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 居民服务实现类
 * 实现居民相关的业务逻辑
 */
@Service
public class ResidentServiceImpl implements ResidentService {
    @Resource
    private ResidentsMapper residentsMapper;
    
    /**
     * 更新居民信息
     * @param residents 居民信息对象
     * @return 返回更新操作的响应结果
     */
    @Override
    public ResponseUtil update(Residents residents) {
        Integer result = residentsMapper.update(residents);
        return result > 0 ? ResponseUtil.get(ResponseEnum.OK)
                : ResponseUtil.get(ResponseEnum.FAIL);
    }
}
